home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / snmp-dev.000 / snmp-dev / snmp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-09  |  3.5 KB  |  104 lines

  1. /*
  2.  * Definitions for the Simple Network Management Protocol (RFC 1067).
  3.  *
  4.  *
  5.  */
  6. /***********************************************************
  7.     Copyright 1988, 1989 by Carnegie Mellon University
  8.  
  9.                       All Rights Reserved
  10.  
  11. Permission to use, copy, modify, and distribute this software and its 
  12. documentation for any purpose and without fee is hereby granted, 
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in 
  15. supporting documentation, and that the name of CMU not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.  
  18.  
  19. CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26. ******************************************************************/
  27.  
  28. #define SNMP_PORT        161
  29. #define SNMP_TRAP_PORT        162
  30.  
  31. #define SNMP_MAX_LEN        1500
  32.  
  33. #define SNMP_VERSION_1        0
  34. #define SNMP_SECURITY_1     1
  35. #define SNMP_VERSION_2        2
  36.  
  37. #define GET_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0)
  38. #define GETNEXT_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1)
  39. #define GET_RSP_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2)
  40. #define SET_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3)
  41. #define TRP_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)
  42. #define BULK_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
  43. #define INFORM_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
  44. #define TRP2_REQ_MSG        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
  45.  
  46. #define SNMP_NOSUCHOBJECT    (ASN_CONTEXT | ASN_PRIMITIVE | 0x0)
  47. #define SNMP_NOSUCHINSTANCE  (ASN_CONTEXT | ASN_PRIMITIVE | 0x1)
  48. #define SNMP_ENDOFMIBVIEW    (ASN_CONTEXT | ASN_PRIMITIVE | 0x2)
  49.  
  50. #define SNMP_ERR_NOERROR    (0x0)
  51. #define SNMP_ERR_TOOBIG        (0x1)
  52. #define SNMP_ERR_NOSUCHNAME (0x2)
  53. #define SNMP_ERR_BADVALUE   (0x3)
  54. #define SNMP_ERR_READONLY   (0x4)
  55. #define SNMP_ERR_GENERR        (0x5)
  56.  
  57. #define SNMP_ERR_NOACCESS        (6)
  58. #define SNMP_ERR_WRONGTYPE        (7)
  59. #define SNMP_ERR_WRONGLENGTH        (8)
  60. #define SNMP_ERR_WRONGENCODING        (9)
  61. #define SNMP_ERR_WRONGVALUE        (10)
  62. #define SNMP_ERR_NOCREATION        (11)
  63. #define SNMP_ERR_INCONSISTENTVALUE    (12)
  64. #define SNMP_ERR_RESOURCEUNAVAILABLE    (13)
  65. #define SNMP_ERR_COMMITFAILED        (14)
  66. #define SNMP_ERR_UNDOFAILED        (15)
  67. #define SNMP_ERR_AUTHORIZATIONERROR    (16)
  68. #define SNMP_ERR_NOTWRITABLE        (17)
  69.  
  70. #define SNMP_TRAP_COLDSTART        (0x0)
  71. #define SNMP_TRAP_WARMSTART        (0x1)
  72. #define SNMP_TRAP_LINKDOWN        (0x2)
  73. #define SNMP_TRAP_LINKUP        (0x3)
  74. #define SNMP_TRAP_AUTHFAIL        (0x4)
  75. #define SNMP_TRAP_EGPNEIGHBORLOSS    (0x5)
  76. #define SNMP_TRAP_ENTERPRISESPECIFIC    (0x6)
  77.  
  78. /* config: */
  79.  
  80. typedef struct _conf_if_list {
  81.   char *name;
  82.   int type;
  83.   int speed;
  84.   struct _conf_if_list *next;
  85. } conf_if_list;
  86.  
  87. extern conf_if_list *if_list;
  88.  
  89. extern char *party_conf ();
  90. extern char *view_conf ();
  91. extern char *acl_conf ();
  92. extern char *context_conf ();
  93.  
  94. extern int read_objid ();
  95. extern void print_objid ();
  96. extern int read_party_database ();
  97. extern int read_context_database ();
  98. extern int read_acl_database ();
  99. extern int ms_party_init ();
  100. extern void snmp_add_null_var ();
  101. extern void xdump ();
  102. extern void snmp_synch_setup ();
  103. extern int snmp_synch_response ();
  104.